package com.cw.demo.tomcat.servlet;

import com.cw.demo.tomcat.http.Request;
import com.cw.demo.tomcat.http.Response;

/**
 * TODO
 *
 * @author chenw
 * @date 2021/2/3
 */
public abstract class MyHttpServlet implements MyServlet{

    @Override
    public void service(Request request, Response response) throws Exception {
        if("get".equalsIgnoreCase(request.getMethod())){
            this.doGet(request,response);
        }else{
            this.doPost(request,response);
        }
    }
    public abstract void doGet(Request request,Response response);
    public abstract void doPost(Request request,Response response);
}
